package com.itheima05;

public class MyStringDemo {
    public static void main(String[] args) {

        useMyString((s, x, y) -> {
            return s.substring(x, y);
        });

        useMyString((s, x, y) -> s.substring(x, y));

        // 引用类的实例方法
        useMyString(String::substring);
    }

    private static void useMyString(MyString m) {
        String s = m.mySubString("hello world", 2, 8);
        System.out.println(s);
    }
}
